package com.gakj.truck.third.api.quartz;

import com.alibaba.fastjson.JSONObject;
import com.gakj.truck.third.api.service.TruckOumanService;
import com.gakj.truck.third.constant.Constants;
import com.gakj.truck.third.core.utils.DateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * Created by gc on 2016/7/12.
 */
@Component
public class FixedGetOumanTruckTask {
    private static final Logger LOGGER = LoggerFactory.getLogger(FixedGetOumanTruckTask.class);

    @Autowired
    TruckOumanService oumanService;

    public void getTruckTask(){

        LOGGER.info("开始获取欧曼数据:"+ DateUtil.defaultFormateDateToString(new Date()));
        LOGGER.info("***************************************************************************");
        JSONObject json = oumanService.getTurckFromOuman(Constants.DATA_FIXED_TIME);
        LOGGER.info(json.toString());
        LOGGER.info("***************************************************************************");
        LOGGER.info("获取欧曼数据结束:"+ DateUtil.defaultFormateDateToString(new Date()));
    }
}
